package com.ylbh.modules.feedback.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylbh.common.pojo.feedback.dto.FeedbackDTO;
import com.ylbh.modules.feedback.entity.ShoppingFeedback;
import com.ylbh.modules.feedback.mapper.ShoppingFeedbackMapper;
import com.ylbh.modules.feedback.service.ShoppingFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ylbh.common.utils.PageUtils;


@Service("shoppingFeedbackService")
public class ShoppingFeedbackServiceImpl extends ServiceImpl<ShoppingFeedbackMapper, ShoppingFeedback> implements ShoppingFeedbackService {

    @Autowired
    private ShoppingFeedbackMapper shoppingFeedbackMapper;

    @Override
    public PageUtils queryFeedbackList(FeedbackDTO feedbackDTO) {
        Page<Integer> page = new Page<>(feedbackDTO.getPage(), feedbackDTO.getLimit());
        List<ShoppingFeedback> list = shoppingFeedbackMapper.selectFeedbackList(feedbackDTO, page);
        return new PageUtils(new Page<ShoppingFeedback>().setTotal(page.getTotal()).setRecords(list));
    }

}
